home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3624 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.5 KB

  1. Path: news.rain.org!usenet
  2. From: "Guus Leeuw jr." <guusl@eiffel.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: C++ and lex?
  5. Date: Wed, 24 Jan 1996 15:56:03 -0800
  6. Organization: ISE Inc. http://www.eiffel.com
  7. Message-ID: <3106C713.7D8CBABC@eiffel.com>
  8. References: <4dugkp$fl8@apakabar.cc.columbia.edu>
  9. NNTP-Posting-Host: @outback.eiffel.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b3 (X11; I; Linux 1.2.8 i586)
  14. CC: guusl
  15.  
  16. Paul E Gunnells wrote:
  17. > Hello everyone:
  18. > Has anyone ever tried using lex along with iostream.h to handle input?
  19. > Or better yet, is there some equivalent to lex that works well with
  20. > C++?
  21.  
  22. I never tried it, though, but my man page for `flex' tells me that it is
  23. possible. It's still experimental in my version (2.5.2). It tells that
  24. the C++ counterpart is able to handle `istream' and `ostream' classes.
  25.  
  26. > Of course, one solution is to have an extern C function yylex() that
  27. > just returns tokens that your C++ program deals with, but a better
  28. > solution (at least a cleaner solution) would be a version of lex that
  29. > allows you to directly incorporate C++ code (streams, constructors)
  30. > into the lex source.
  31. > Is there such a beast?
  32.  
  33. Assuming a UNIX(like) environment: try `man flex' or `flex++ --version'.
  34. It will you more.
  35.  
  36. If you're, for some reason, not able to `flex', I can get you a copy of
  37. the man-page part that tells about C++, and a copy of the distributors
  38. via e-mail, if you want to. Just contact me.
  39.  
  40. > Paul Gunnells
  41.  
  42. Regards,
  43.     Guus Leeuw jr.
  44.     guusl@eiffel.com
  45.